package org.teamh.gui.ingame;

import org.teamh.gui.GUI;
import org.teamh.gui.ingame.chat.ChatManager;

import de.lessvoid.nifty.builder.EffectBuilder;
import de.lessvoid.nifty.builder.ImageBuilder;
import de.lessvoid.nifty.builder.LayerBuilder;
import de.lessvoid.nifty.builder.PanelBuilder;
import de.lessvoid.nifty.builder.ScreenBuilder;
import de.lessvoid.nifty.builder.TextBuilder;
import de.lessvoid.nifty.controls.button.builder.ButtonBuilder;
import de.lessvoid.nifty.controls.listbox.builder.ListBoxBuilder;
import de.lessvoid.nifty.controls.dropdown.builder.DropDownBuilder;
import de.lessvoid.nifty.controls.textfield.builder.TextFieldBuilder;
import de.lessvoid.nifty.elements.Element;
import de.lessvoid.nifty.tools.Color;

public class IngameScreenHUD {
	private GUI gui;
	private IngameController controller;
	private ChatManager chatManager;
	private Element tileSelectionPopup;
	
	public IngameScreenHUD(GUI gui){
		this.gui=gui;
		this.controller = new IngameController(gui,this);
		chatManager = new ChatManager(gui); 
	}
	
	public void build() {
		de.lessvoid.nifty.screen.Screen screen = new ScreenBuilder("ingameScreen") {{
			controller(controller);		
				layer(new LayerBuilder() {
					{
						//
						childLayoutHorizontal();
						alignRight();	
						

						//TileSelection Outer
						panel(new PanelBuilder("tileSelection"){{
							childLayoutAbsolute();		
							width("0");
						    height("0");
                            visible(false);
						//TileSelection
						panel(new PanelBuilder(){{
							childLayoutCenter();
							backgroundColor("#000");			
							width("1024");
						    height("768");
						    paddingTop("11");
						    paddingLeft("2");
						    //Vertikales aeusseres Panel
						    panel(new PanelBuilder() {{
								childLayoutVertical();
								paddingTop("5");
								paddingLeft("15");
								width("1037");
								height("782");
								backgroundColor("#666a");
								//style("nifty-panel");
								//Panel um oberen Text
							    panel(new PanelBuilder() {{
									childLayoutCenter();
									width("600");
									height("40");
									text(new TextBuilder() {{
										font("verdana-small-regular.fnt");
										color(new Color(1,1,1,1));
										text("Please choose your tile.");
									}});
							    }});
							   //ENDE Panel um oberen Text
							    //Panel um tile1 und 2
							    panel(new PanelBuilder() {{
									childLayoutHorizontal();
									paddingLeft("90");
									width("600");
									height("200");
									 //tile1
								    panel(new PanelBuilder("tile1outer") {{
								    	visible(false);
										childLayoutCenter();
										width("200");
										height("200");
										backgroundColor("#fffa");	
									    panel(new PanelBuilder() {{
											childLayoutCenter();
											width("190");
											height("190");
											backgroundColor("#000e");	
											interactOnClick("tileClick1(tile1)");
									    }});
								    }});
								    //ENDE  tile1
									 //tile2
								    panel(new PanelBuilder("tile2outer") {{
								    	visible(false);
										childLayoutCenter();
										width("200");
										height("200");
										backgroundColor("#fffa");	
									    panel(new PanelBuilder() {{
											childLayoutCenter();
											width("190");
											height("190");
											backgroundColor("#000e");
											interactOnClick("tileClick1(tile2)");
									    }});
								    }});
								    //ENDE  tile2
									
							    }});
							    //ENDE  Panel um tile1 und 2
							    //Panel um tile3 und 4
							    panel(new PanelBuilder() {{
									childLayoutHorizontal();
									paddingLeft("90");
									width("600");
									height("200");
									 //tile3
								    panel(new PanelBuilder("tile3outer") {{
								    	visible(false);
										childLayoutCenter();
										width("200");
										height("200");
										backgroundColor("#fffa");	
									    panel(new PanelBuilder() {{
											childLayoutCenter();
											width("190");
											height("190");
											backgroundColor("#000e");	
											interactOnClick("tileClick1(tile3)");
									    }});
								    }});
								    //ENDE  tile3
									 //tile4
								    panel(new PanelBuilder("tile4outer") {{
								    	visible(false);
										childLayoutCenter();
										width("200");
										height("200");
										backgroundColor("#fffa");	
									    panel(new PanelBuilder() {{
											childLayoutCenter();
											width("190");
											height("190");
											backgroundColor("#000e");
											interactOnClick("tileClick1(tile4)");
									    }});
								    }});
								    //ENDE  tile4
									
							    }});//ENDE  Panel um tile3 und 4					
							    //Panel um unteren Bereich
							  //Panel um Readybutton + startGameCountdown
							    panel(new PanelBuilder() {{
							    	visibleToMouse(true);
									childLayoutHorizontal();
									paddingTop("20");
									paddingLeft("120");
									width("600");
									height("120");
									//Panel um readyButton
									panel(new PanelBuilder() {{
										childLayoutCenter();
										width("110");
										height("20");
									control(new ButtonBuilder("readyButton", "READY") {{
										alignLeft();
										valignCenter();
										interactOnClick("readyButtonclick()");
										width("100px");
									}});
									}});//ENDE Panel um readyButton
									//Panel um Infotexte
									panel(new PanelBuilder() {{
										childLayoutCenter();
										width("400");
										height("13");
									//startgameCountdown
									panel(new PanelBuilder("startGameCountdownPanel") {{
										childLayoutHorizontal();
										width("400");
										height("20");
										visible(false);
									text(new TextBuilder() {{
										font("verdana-small-regular.fnt");
										color(new Color(1,1,1,1));
										text("   Game starts in ");
									}});
									text(new TextBuilder("startGameCountdownnumber") {{
										font("verdana-small-regular.fnt");
										color(new Color(1,1,1,1));
										text("5");
									}});
									text(new TextBuilder() {{
										font("verdana-small-regular.fnt");
										color(new Color(1,1,1,1));
										text(" Seconds");
									}});
									}});//ENDE startgameCountdown
									//noTileChoosedPanel
									panel(new PanelBuilder("noTileChoosedPanel") {{
										childLayoutHorizontal();
										width("400");
										height("20");
										visible(false);
									text(new TextBuilder() {{
										font("verdana-small-regular.fnt");
										color(new Color(1,1,1,1));
										text("You haven't choosed a tile.");
									}});
									}});//ENDE noTileChoosedPanel
									//waitingForOtherPlayers
									panel(new PanelBuilder("waitingForOtherPlayers") {{
										childLayoutHorizontal();
										width("400");
										height("20");
										visible(false);
									text(new TextBuilder() {{
										font("verdana-small-regular.fnt");
										color(new Color(1,1,1,1));
										text("waiting for other players");
										onActiveEffect(new EffectBuilder("colorPulsate") {{
						    		        effectParameter("period", "1600");
						    		        effectParameter("startColor", "#00000000");
						    		        effectParameter("endColor", "#ffffffff");
						    				}});	
									}});
									}});//ENDE waitingForOtherPlayers
									}});//ENDE //Panel um Infotexte
							    }});//ENDE Panel um Readybutton + startGameCountdown
							    //ENDE  Panel um unteren Bereich	
							  //start chatbox panel
								panel(new PanelBuilder("chatbox_panelTileSeletion") {{
									childLayoutCenter();
									height("185");
									width("1005");
									panel(new PanelBuilder() {{
										childLayoutVertical();
										alignCenter();
										style("nifty-panel");
										//backgroundColor("#000a");
										height("300px");
										width("1030px");
										control(new ListBoxBuilder("chatBoxTileSelection") {{
											style("nifty-listbox");
											displayItems(9);
											selectionModeDisabled();
											hideHorizontalScrollbar();
											optionalVerticalScrollbar();
											height("100");
											width("780px");
										}});
									}});
									//ChatnachrichtenEingabe und Button
									panel(new PanelBuilder() {{
										paddingTop("175");
										paddingLeft("3");
										childLayoutHorizontal();
										control(new TextFieldBuilder("chatMessagesFieldTileSelection", "") {{ 
											alignCenter();
											valignCenter();
											maxLength(255);
											width("659");
										}});
										panel(new PanelBuilder() {{
											width("21px");
										}});
										control(new ButtonBuilder("sendButtonTileSelection", "Send") {{
											alignCenter();
											valignCenter();
											//interactOnClick("sendMessageTileSelection()");
											interactOnClick("sendMessageIngame()");
											width("100px");
										}});
									}});//ENDE ChatnachrichtenEingabe und Button
								}});
								//end chatbox panel
								
								
								  //PlayerListbox TileSelection
								panel(new PanelBuilder() {{
									childLayoutAbsolute();
									height("0");
									width("0");
									panel(new PanelBuilder() {{
										paddingLeft("720");
										childLayoutVertical();
										//style("nifty-panel");
										//backgroundColor("#000a");
										height("300px");
										width("300px");
										panel(new PanelBuilder() {{
											childLayoutVertical();
											paddingTop("5");
											paddingLeft("5");
											backgroundColor("#333a");
											height("507px");
											width("340px");
											//PlayersText
											panel(new PanelBuilder() {{
												childLayoutCenter();
												backgroundColor("#222a");
												width("290");
												height("40");
											text(new TextBuilder() {{
												font("verdana-small-regular.fnt");
												color(new Color(1,1,1,1));
												text("Players");	
											}});
											}});//ENDE PlayersText
											//Player1
											panel(new PanelBuilder("listpanelPlayer1") {{
												visible(false);
												childLayoutCenter();
												backgroundColor("#444a");
												width("290");
												height("80");
												paddingLeft("10");
												paddingRight("20");
											text(new TextBuilder("namePlayer1") {{
												alignLeft();
												font("verdana-small-regular.fnt");
												color(new Color(1,1,1,1));
												text("Player1");	
											}});
											text(new TextBuilder(("readyValuePlayer1")) {{
												alignRight();
												font("verdana-small-regular.fnt");
												color(new Color(1,0,0,1f));
												text("not ready");	
											}});
											}});//ENDE Player1
											panel(new PanelBuilder() {{
												height("2");
											}});
											//Player2
											panel(new PanelBuilder("listpanelPlayer2") {{
												visible(false);
												childLayoutCenter();
												backgroundColor("#444a");
												width("290");
												height("80");
												paddingLeft("10");
												paddingRight("20");
											text(new TextBuilder("namePlayer2") {{
												alignLeft();
												font("verdana-small-regular.fnt");
												color(new Color(1,1,1,1));
												text("Player2");	
											}});
											text(new TextBuilder(("readyValuePlayer2")) {{
												alignRight();
												font("verdana-small-regular.fnt");
												color(new Color(1,0,0,1f));
												text("not ready");	
											}});
											}});//ENDE Player2
											panel(new PanelBuilder() {{
												height("2");
											}});
											//Player3
											panel(new PanelBuilder("listpanelPlayer3") {{
												visible(false);
												childLayoutCenter();
												backgroundColor("#444a");
												width("290");
												height("80");
												paddingLeft("10");
												paddingRight("20");
											text(new TextBuilder("namePlayer3") {{
												alignLeft();
												font("verdana-small-regular.fnt");
												color(new Color(1,1,1,1));
												text("Player3");	
											}});
											text(new TextBuilder(("readyValuePlayer3")) {{
												alignRight();
												font("verdana-small-regular.fnt");
												color(new Color(1,0,0,1f));
												text("not ready");	
											}});
											}});//ENDE Player3
											panel(new PanelBuilder() {{
												height("2");
											}});
											//Player4
											panel(new PanelBuilder("listpanelPlayer4") {{
												visible(false);
												childLayoutCenter();
												backgroundColor("#444a");
												width("290");
												height("80");
												paddingLeft("10");
												paddingRight("20");
											text(new TextBuilder("namePlayer4") {{
												alignLeft();
												font("verdana-small-regular.fnt");
												color(new Color(1,1,1,1));
												text("You");	
											}});
											text(new TextBuilder(("readyValuePlayer4")) {{
												alignRight();
												font("verdana-small-regular.fnt");
												color(new Color(1,0,0,1f));
												text("not ready");	
											}});
											}});//ENDE Player4
											
											
										}});

									}});
								}});
								//PlayerListbox TileSelection
						    }});
						    //Ende Verticalesaeusseres Panel
							
						}});//ENDE TileSelection	
					}});//ENDE TileSelection Outer	
						
					//Panel um FELD2 und FELD3
						panel(chatManager.getGUI());
						panel(new PanelBuilder(){{
							paddingLeft("0px");
							paddingTop("13px");
							childLayoutCenter();
							width("*");
							height("768px");
						//FELD3 rechte Kontrollleiste �u�eres Panel
						panel(new PanelBuilder("controlPanel"){{
							alignRight();
							childLayoutVertical();
							height("781");
							width("265" );	
							style("nifty-panel");
							
							//Leben/Gold-Anzeige
							panel(new PanelBuilder(){{
								childLayoutHorizontal();
								paddingLeft("10");
								height("25");
								width("230");
								//Lebensanzeige
								panel(new PanelBuilder(){{
									childLayoutHorizontal();
									height("35");
									width("60");

									image(new ImageBuilder("LifeImage") {{
										filename("res/img/ingame/lifebig.png");
										height("30");
										width("30");
										alignLeft();
										valignCenter();
									}});
									text(new TextBuilder("LifeValue") {{
										font("verdana-small-regular.fnt");
										color(new Color(1,1,1,1));
										width("30");
										text("-");
										valignBottom();
										alignRight();
									}});
								}});//Ende Lebenanzeige
								//Goldanzeige
								panel(new PanelBuilder(){{
									childLayoutHorizontal();
									paddingLeft("20");
									height("35");
									width("132");
									image(new ImageBuilder("GoldImage") {{
										filename("res/img/ingame/goldbig.png");
										height("30");
										width("30");
										alignLeft();
										valignCenter();
									}});
									text(new TextBuilder("GoldValue") {{
										font("verdana-small-regular.fnt");
										color(new Color(1,1,1,1));
										text("-");
										alignCenter();
										valignBottom();
										width("107");
									}});
								}});//Ende Lebenanzeige
								
							}});							
							//ENDE Leben/Gold-Anzeige
							//Creep/Tower Buttons
							panel(new PanelBuilder(){{
								paddingTop("13");
								paddingLeft("35");
								childLayoutHorizontal();
								control(new ButtonBuilder("creepsButton", "CREEPS") {{
									width("80");
									height("30");
									interactOnClick("showCreepSelection()");
									visibleToMouse(true);
								}});
								control(new ButtonBuilder("towersButton", "TOWERS") {{
									width("80");
									height("30");
									interactOnClick("showTowerSelection()");
									visibleToMouse(true);
								}});
							}});
								//ENDE Creep/Tower Buttons
							//Panel um Creep/Towerauswahl plus jeweilige Infos
							panel(new PanelBuilder(){{
								childLayoutCenter();
								height("380");
								width("230");
							//Panel um Creepauwahl+Creep-Informationen
								panel(new PanelBuilder("CreepSelection"){{
									childLayoutVertical();
									height("380");
									width("230");	
									visible(false);
							//Creep-Auswahl
							panel(new PanelBuilder("CreepPanel"){{
								childLayoutCenter();
								height("380");
								width("230");
								//backgroundColor(new Color(0,0,0,0.1f));
						
										//Zeilen CreepAuswahl
										panel(new PanelBuilder(){{
											childLayoutVertical();
											height("355");
											width("205");
											paddingLeft("19");
											style("nifty-panel");
											//Zeile1 CreepAuswahl
											panel(new PanelBuilder(){{
												childLayoutHorizontal();
												height("54");
												width("205");										
												//ImageCreep1	
												panel(new PanelBuilder("creep1"){{
													childLayoutCenter();
													width("54");
													height("54");
													image(new ImageBuilder("creep1Image"){{
													filename("res/img/ingameControlbar/creep1.png");
													width("50");
													height("50");
													alignCenter();
								    				valignCenter();
								    				visible(true);
								    				interactOnClick("creepclick(0)");
								    				interactOnMouseOver("showInformationtextAndHovereffect(creep1)");
													}});
												}});	
												//Ende ImageCreep1
												//ImageCreep2	
												panel(new PanelBuilder("creep2"){{
													childLayoutCenter();
													width("54");
													height("54");
													image(new ImageBuilder("creep2Image"){{
													filename("res/img/ingameControlbar/creep2.png");
													width("50");
													height("50");
													alignCenter();
								    				valignCenter();
								    				visible(true);
								    				interactOnClick("creepclick(1)");
								    				interactOnMouseOver("showInformationtextAndHovereffect(creep2)");
													}});
												}});
												//Ende ImageCreep2
												//ImageCreep3
												panel(new PanelBuilder("creep3"){{
												    childLayoutCenter();
												    width("54");
													height("54");	
													image(new ImageBuilder("creep3Image"){{
													filename("res/img/ingameControlbar/creep3.png");
													width("50");
													height("50");
													alignCenter();
								    				valignCenter();
								    				visible(true);
								    				interactOnClick("creepclick(2)");
								    				interactOnMouseOver("showInformationtextAndHovereffect(creep3)");
													}});
												}});
												//Ende ImageCreep3

											}});	
											//ENDE Zeile1 CreepAuswahl
											//Zeile2 CreepAuswahl
											panel(new PanelBuilder(){{
												childLayoutHorizontal();
												height("54");
												width("205");
											
												//ImageCreep1	
												panel(new PanelBuilder("creep4"){{
													childLayoutCenter();
													width("54");
													height("54");
													image(new ImageBuilder("creep4Image"){{
													filename("res/img/ingameControlbar/creep4.png");
													width("50");
													height("50");
													alignCenter();
								    				valignCenter();
								    				visible(true);
								    				interactOnClick("creepclick(3)");
								    				interactOnMouseOver("showInformationtextAndHovereffect(creep4)");
													}});
												}});	
												//Ende ImageCreep1
												//ImageCreep2	
												panel(new PanelBuilder("creep5"){{
													childLayoutCenter();
													width("54");
													height("54");
													image(new ImageBuilder("creep5Image"){{
													filename("res/img/ingameControlbar/creep5.png");
													width("50");
													height("50");
													alignCenter();
								    				valignCenter();
								    				visible(true);
								    				interactOnClick("creepclick(4)");
								    				interactOnMouseOver("showInformationtextAndHovereffect(creep5)");
													}});
												}});
												//Ende ImageCreep2
												//ImageCreep3
												panel(new PanelBuilder("creep6"){{
												    childLayoutCenter();
												    width("54");
													height("54");	
													image(new ImageBuilder("creep6Image"){{
													filename("res/img/ingameControlbar/creep6.png");
													width("50");
													height("50");
													alignCenter();
								    				valignCenter();
								    				visible(true);
								    				interactOnClick("creepclick(5)");
								    				interactOnMouseOver("showInformationtextAndHovereffect(creep6)");
													}});
												}});
												//Ende ImageCreep3

											}});
											//ENDE Zeile2 CreepAuswahl
											//Zeile3 CreepAuswahl
											panel(new PanelBuilder(){{
												childLayoutHorizontal();
												height("54");
												width("205");
											
												//ImageCreep1	
												panel(new PanelBuilder("creep7"){{
													childLayoutCenter();
													width("54");
													height("54");
													image(new ImageBuilder("creep7Image"){{
													filename("res/img/ingameControlbar/creep7.png");
													width("50");
													height("50");
													alignCenter();
								    				valignCenter();
								    				visible(true);
								    				interactOnClick("creepclick(6)");
								    				interactOnMouseOver("showInformationtextAndHovereffect(creep7)");
													}});
												}});	
												//Ende ImageCreep1
												//ImageCreep2	
												panel(new PanelBuilder("creep8"){{
													childLayoutCenter();
													width("54");
													height("54");
													image(new ImageBuilder("creep8Image"){{
													filename("res/img/ingameControlbar/creep8.png");
													width("50");
													height("50");
													alignCenter();
								    				valignCenter();
								    				visible(true);
								    				interactOnClick("creepclick(7)");
								    				interactOnMouseOver("showInformationtextAndHovereffect(creep8)");
													}});
												}});
												//Ende ImageCreep2
												//ImageCreep3
												panel(new PanelBuilder("creep9"){{
												    childLayoutCenter();
												    width("54");
													height("54");	
													image(new ImageBuilder("creep9Image"){{
													filename("res/img/ingameControlbar/creep9.png");
													width("50");
													height("50");
													alignCenter();
								    				valignCenter();
								    				visible(true);
								    				interactOnClick("creepclick(8)");
								    				interactOnMouseOver("showInformationtextAndHovereffect(creep9)");
													}});
												}});
												//Ende ImageCreep3

											}});	
											//ENDE Zeile3 CreepAuswahl
											//Zeile4 CreepAuswahl
											panel(new PanelBuilder(){{
												childLayoutHorizontal();
												height("54");
												width("205");
											
												//ImageCreep1	
												panel(new PanelBuilder("creep10"){{
													childLayoutCenter();
													width("54");
													height("54");
													image(new ImageBuilder("creep10Image"){{
													filename("res/img/ingameControlbar/creep10.png");
													width("50");
													height("50");
													alignCenter();
								    				valignCenter();
								    				visible(true);
								    				interactOnClick("creepclick(9)");
								    				interactOnMouseOver("showInformationtextAndHovereffect(creep10)");
													}});
												}});	
												//Ende ImageCreep1
												//ImageCreep2	
												panel(new PanelBuilder("creep11"){{
													childLayoutCenter();
													width("54");
													height("54");
													image(new ImageBuilder("creep11Image"){{
													filename("res/img/ingameControlbar/creep11.png");
													width("50");
													height("50");
													alignCenter();
								    				valignCenter();
								    				visible(true);
								    				interactOnClick("creepclick(10)");
								    				interactOnMouseOver("showInformationtextAndHovereffect(creep11)");
													}});
												}});
												//Ende ImageCreep2
												//ImageCreep3
												panel(new PanelBuilder("creep12"){{
												    childLayoutCenter();
												    width("54");
													height("54");	
													image(new ImageBuilder("creep12Image"){{
													filename("res/img/ingameControlbar/creep12.png");
													width("50");
													height("50");
													alignCenter();
								    				valignCenter();
								    				visible(true);
								    				interactOnClick("creepclick(11)");
								    				interactOnMouseOver("showInformationtextAndHovereffect(creep12)");
													}});
												}});
												//Ende ImageCreep3

											}});	
											//ENDE Zeile4 CreepAuswahl
											//Zeile5 CreepAuswahl
											panel(new PanelBuilder(){{
												childLayoutHorizontal();
												height("54");
												width("205");
											
												//ImageCreep1	
												panel(new PanelBuilder("creep13"){{
													childLayoutCenter();
													width("54");
													height("54");
													image(new ImageBuilder("creep13Image"){{
													filename("res/img/ingameControlbar/creep13.png");
													width("50");
													height("50");
													alignCenter();
								    				valignCenter();
								    				visible(true);
								    				interactOnClick("creepclick(12)");
								    				interactOnMouseOver("showInformationtextAndHovereffect(creep13)");
													}});
												}});	
												//Ende ImageCreep1
												//ImageCreep2	
												panel(new PanelBuilder("creep14"){{
													childLayoutCenter();
													width("54");
													height("54");
													image(new ImageBuilder("creep14Image"){{
													filename("res/img/ingameControlbar/creep14.png");
													width("50");
													height("50");
													alignCenter();
								    				valignCenter();
								    				visible(true);
								    				interactOnClick("creepclick(13)");
								    				interactOnMouseOver("showInformationtextAndHovereffect(creep14)");
													}});
												}});
												//Ende ImageCreep2
												//ImageCreep3
												panel(new PanelBuilder("creep15"){{
												    childLayoutCenter();
												    width("54");
													height("54");	
													image(new ImageBuilder("creep15Image"){{
													filename("res/img/ingameControlbar/creep15.png");
													width("50");
													height("50");
													alignCenter();
								    				valignCenter();
								    				visible(true);
								    				interactOnClick("creepclick(14)");
								    				interactOnMouseOver("showInformationtextAndHovereffect(creep15)");
													}});
												}});
												//Ende ImageCreep3

											}});	
											//ENDE Zeile5 CreepAuswahl
											//Zeile3 CreepAuswahl
											panel(new PanelBuilder(){{
												childLayoutHorizontal();
												height("54");
												width("205");
											    paddingLeft("54");
												//ImageCreep1	
												panel(new PanelBuilder("creep16"){{
													childLayoutCenter();
													width("54");
													height("54");
													image(new ImageBuilder("creep16Image"){{
													filename("res/img/ingameControlbar/creep16.png");
													width("50");
													height("50");
													alignCenter();
								    				valignCenter();
								    				visible(true);
								    				interactOnClick("creepclick(15)");
								    				interactOnMouseOver("showInformationtextAndHovereffect(creep16)");
													}});
												}});	
												//Ende ImageCreep1
											}});
											//ENDE Zeile6 CreepAuswahl
											
										}});//ENDE Zeilen CreepAuswahl							
								
								
							}});							
							//ENDE Creep-Auswahl
							panel(new PanelBuilder() {{
								childLayoutCenter();
								//Creep-Informationen
								panel(new PanelBuilder("Creep Information"){{
									childLayoutCenter();
									height("280");
									width("232");
									
									//Zeilen
									panel(new PanelBuilder(){{
										childLayoutVertical();
										height("303");
										width("235");
										paddingLeft("20");
										backgroundColor(new Color(0,0,0,0.15f));
										//Zeile1
										panel(new PanelBuilder(){{
											childLayoutCenter();
											height("40");
											width("190");
											text(new TextBuilder("CreepName") {{
												font("verdana-small-regular.fnt");
												color(new Color(1,1,1,1));
												text("-");
											}});
										}});	
										//ENDE Zeile1
										//Zeile2
										panel(new PanelBuilder(){{
											childLayoutCenter();
											height("30");
											width("175");
											text(new TextBuilder("PriceText") {{
												font("verdana-small-regular.fnt");
												color(new Color(1,1,1,1));
												text("Price");
												alignLeft();
											}});
											text(new TextBuilder("PriceValue") {{
												font("verdana-small-regular.fnt");
												color(new Color(1,1,1,1));
												text("-");
												alignRight();
											}});
										}});	
										//ENDE Zeile2
										//Zeile3
										panel(new PanelBuilder(){{
											childLayoutCenter();
											height("30");
											width("175");
											text(new TextBuilder("HealthText") {{
												font("verdana-small-regular.fnt");
												color(new Color(1,1,1,1));
												text("Health");
												alignLeft();
											}});
											text(new TextBuilder("HealthValue") {{
												font("verdana-small-regular.fnt");
												color(new Color(1,1,1,1));
												text("-");
												alignRight();
											}});
										}});	
										//ENDE Zeile3
										//Zeile4
										panel(new PanelBuilder(){{
											childLayoutCenter();
											height("30");
											width("175");
											text(new TextBuilder("SpeedText") {{
												font("verdana-small-regular.fnt");
												color(new Color(1,1,1,1));
												text("Speed");
												alignLeft();
											}});
											text(new TextBuilder("SpeedValue") {{
												font("verdana-small-regular.fnt");
												color(new Color(1,1,1,1));
												text("-");
												alignRight();
											}});
										}});	
										//ENDE Zeile4
										//Zeile5
										panel(new PanelBuilder(){{
											childLayoutCenter();
											height("30");
											width("175");
											text(new TextBuilder("IncomeText") {{
												font("verdana-small-regular.fnt");
												color(new Color(1,1,1,1));
												text("Income");
												alignLeft();
											}});
											text(new TextBuilder("IncomeValue") {{
												font("verdana-small-regular.fnt");
												color(new Color(1,1,1,1));
												text("-");
												alignRight();
											}});
										}});	
										//ENDE Zeile5
										//Zeile6
										panel(new PanelBuilder(){{
											childLayoutCenter();
											height("30");
											width("175");
											text(new TextBuilder("BountyText") {{
												font("verdana-small-regular.fnt");
												color(new Color(1,1,1,1));
												text("Bounty");
												alignLeft();
											}});
											text(new TextBuilder("BountyValue") {{
												font("verdana-small-regular.fnt");
												color(new Color(1,1,1,1));
												text("-");
												alignRight();
											}});
										}});	
										//ENDE Zeile6
										//Zeile7 Button
										panel(new PanelBuilder("recruitButtonPanel"){{
											paddingTop("10");
											childLayoutCenter();
											height("30");
											width("205");
											control(new ButtonBuilder("recruitButton", "RECRUIT") {{
												width("120");
												height("30");
												interactOnClick("recruit()");
												visibleToMouse(true);
											}});
										}});	
										//ENDE Zeile7 Button
										
									}});//ENDE Zeilen
									
								}});//ENDE Creep-Informationen
								
								//Tower-Informationen
								panel(new PanelBuilder("Tower Information Creep Panel"){{
									childLayoutCenter();
									height("280");
									width("232");
									//Zeilen
									panel(new PanelBuilder(){{
										childLayoutVertical();
										height("303");
										width("235");
										paddingLeft("10");
										backgroundColor(new Color(0,0,0,0.15f));
										//Zeile1
										panel(new PanelBuilder(){{
											childLayoutHorizontal();
											height("40");
											width("210");
											text(new TextBuilder("TowerName Creep Panel") {{
												font("verdana-small-regular.fnt");
												color(new Color(1,1,1,1));
												text("-");
												alignLeft();
												width("100");
												textHAlignLeft();
											}});
											text(new TextBuilder("TowerLevel Creep Panel") {{
												font("verdana-small-regular.fnt");
												color(new Color(1,1,1,1));
												text("-");
												alignRight();
												width("110");
												textHAlignRight();
											}});
										}});	
										//ENDE Zeile1
										//Zeile2
										panel(new PanelBuilder(){{
											childLayoutHorizontal();
											height("25");
											width("210");
											text(new TextBuilder() {{
												font("verdana-small-regular.fnt");
												color(new Color(1,1,1,1));
												text("Price");
												alignLeft();
												width("100");
												textHAlignLeft();
											}});
											text(new TextBuilder("PriceTowerValue Creep Panel") {{
												font("verdana-small-regular.fnt");
												color(new Color(1,1,1,1));
												text("-");
												alignRight();
												width("110");
												textHAlignRight();
											}});
										}});	
										//ENDE Zeile2
										//Zeile3
										panel(new PanelBuilder(){{
											childLayoutHorizontal();
											height("25");
											width("210");
											text(new TextBuilder() {{
												font("verdana-small-regular.fnt");
												color(new Color(1,1,1,1));
												text("Cooldown");
												alignLeft();
												width("100");
												textHAlignLeft();
											}});
											text(new TextBuilder("CooldownTowerValue Creep Panel") {{
												font("verdana-small-regular.fnt");
												color(new Color(1,1,1,1));
												text("-");
												alignRight();
												width("110");
												textHAlignRight();
											}});
										}});	
										//ENDE Zeile3
										//Zeile4
										panel(new PanelBuilder(){{
											childLayoutHorizontal();
											height("25");
											width("210");
											text(new TextBuilder() {{
												font("verdana-small-regular.fnt");
												color(new Color(1,1,1,1));
												text("Range");
												alignLeft();
												width("100");
												textHAlignLeft();
											}});
											text(new TextBuilder("RangeValue Creep Panel") {{
												font("verdana-small-regular.fnt");
												color(new Color(1,1,1,1));
												text("-");
												alignRight();
												width("110");
												textHAlignRight();
											}});
										}});	
										//ENDE Zeile4
										//Zeile5
										panel(new PanelBuilder(){{
											childLayoutHorizontal();
											height("25");
											width("210");
											text(new TextBuilder() {{
												font("verdana-small-regular.fnt");
												color(new Color(1,1,1,1));
												text("Damage");
												alignLeft();
												width("100");
												textHAlignLeft();
											}});
											text(new TextBuilder("TowerDamageValue Creep Panel") {{
												font("verdana-small-regular.fnt");
												color(new Color(1,1,1,1));
												text("-");
												alignRight();
												width("110");
												textHAlignRight();
											}});
										}});	
										//ENDE Zeile5
										//Zeile6
										panel(new PanelBuilder(){{
											childLayoutHorizontal();
											height("25");
											width("210");
											text(new TextBuilder() {{
												font("verdana-small-regular.fnt");
												color(new Color(1,1,1,1));
												text("Spl dmg reduce");
												alignLeft();
												width("100");
												textHAlignLeft();
											}});
											text(new TextBuilder("SplashDamageReduceValue Creep Panel") {{
												font("verdana-small-regular.fnt");
												color(new Color(1,1,1,1));
												text("-");
												alignRight();
												width("110");
												textHAlignRight();
											}});
										}});	
										//ENDE Zeile6
										//Zeile7
										panel(new PanelBuilder(){{
											childLayoutHorizontal();
											height("25");
											width("210");
											text(new TextBuilder() {{
												font("verdana-small-regular.fnt");
												color(new Color(1,1,1,1));
												text("Splashradius");
												alignLeft();
												width("100");
												textHAlignLeft();
											}});
											text(new TextBuilder("SplashRadiusValue Creep Panel") {{
												font("verdana-small-regular.fnt");
												color(new Color(1,1,1,1));
												text("-");
												alignRight();
												width("110");
												textHAlignRight();
											}});
										}});	
										//ENDE Zeile7
										//Zeile8
										panel(new PanelBuilder(){{
											childLayoutHorizontal();
											height("25");
											width("210");
											text(new TextBuilder() {{
												font("verdana-small-regular.fnt");
												color(new Color(1,1,1,1));
												text("Slowrate");
												alignLeft();
												width("100");
												textHAlignLeft();
											}});
											text(new TextBuilder("SlowrateValue Creep Panel") {{
												font("verdana-small-regular.fnt");
												color(new Color(1,1,1,1));
												text("-");
												alignRight();
												width("110");
												textHAlignRight();
											}});
										}});	
										//ENDE Zeile8
										//Zeile9
										panel(new PanelBuilder(){{
											childLayoutHorizontal();
											height("25");
											width("210");
											text(new TextBuilder() {{
												font("verdana-small-regular.fnt");
												color(new Color(1,1,1,1));
												text("Slowtime");
												alignLeft();
												textHAlignLeft();
												width("100");
											}});
											text(new TextBuilder("SlowtimeValue Creep Panel") {{
												font("verdana-small-regular.fnt");
												color(new Color(1,1,1,1));
												text("-");
												alignRight();
												width("110");
												textHAlignRight();
											}});
										}});	
										//ENDE Zeile9
										//Zeile10 Button
										panel(new PanelBuilder("upgradePanel Creep Panel"){{
											childLayoutVertical();
											paddingTop("5");
											height("60");
											width("210");
											panel(new PanelBuilder(){{
												childLayoutHorizontal();
												height("30");
												control(new ButtonBuilder("upgradeButton Creep Panel", "Upgrade") {{
													width("100");
													interactOnClick("upgradeTower()");
													visibleToMouse(true);
												}});
												panel(new PanelBuilder(){{
													width("15");
												}});
												control(new ButtonBuilder("sellButton Creep Panel", "Sell") {{
													width("100");
													interactOnClick("sellTower()");
													visibleToMouse(true);
												}});
											}});
											panel(new PanelBuilder(){{
												childLayoutHorizontal();
												height("30");
												text(new TextBuilder() {{
													width("60");
													text("Strategy");
													textHAlignLeft();
													alignLeft();
													valignCenter();
												}});
												panel(new PanelBuilder(){{
													width("15");
												}});
												control(new DropDownBuilder("dropDown Creep Panel") {{
													  width("140");
													  alignRight();
													  valignCenter();
												}});
											}});
										}});	
										//ENDE Zeile10 Button
									}});//ENDE Zeilen
								}});
								//Winner/Loser Panel Creep Panel
								panel(new PanelBuilder("Winner Panel Creep Panel") {{
									childLayoutCenter();
									height("280");
									width("232");
									panel(new PanelBuilder(){{
										childLayoutVertical();
										height("303");
										width("235");
										paddingLeft("10");
										paddingTop("20");
										backgroundColor(new Color(0,0,0,0.15f));
										panel(new PanelBuilder() {{
											height("50");
										}});
										text(new TextBuilder("Winner/Loser Text Creep Panel") {{
											alignCenter();
											font("aurulent-sans-36-bold-with-shadow.fnt");
											color(new Color(1,1,1,1));
											text("You Loose!");
										}});
										panel(new PanelBuilder() {{
											height("100");
										}});
										control(new ButtonBuilder("Leave Game Creep Panel", "LEAVE GAME") {{
											alignCenter();
											valignCenter();
											interactOnClick("leaveGame()");
											width("100px");
										}});
									}});
								}});
								//Winner/Loser Panel Creep Panel
								//Tile Selection Creep Panel
								panel(new PanelBuilder("Tile Selection Creep Panel") {{
									childLayoutCenter();
									height("280");
									width("232");
									panel(new PanelBuilder(){{
										childLayoutVertical();
										height("303");
										width("235");
										paddingLeft("20");
										paddingTop("20");
										backgroundColor(new Color(0,0,0,0.15f));
										//Panel um oberen Text
									    panel(new PanelBuilder() {{
											childLayoutCenter();
											height("20");
											text(new TextBuilder() {{
												font("verdana-small-regular.fnt");
												color(new Color(1,1,1,1));
												text("Please choose your tile.");
											}});
									    }});
									   //ENDE Panel um oberen Text
									    //Panel um tile1 und 2
									    panel(new PanelBuilder() {{
											childLayoutHorizontal();
											paddingLeft("10");
											paddingTop("10");
											width("232");
											height("90");
											 //tile1
										    panel(new PanelBuilder("tile1outerCreep") {{
												childLayoutCenter();
												width("90");
												height("90");
												backgroundColor("#fffa");	
											    panel(new PanelBuilder() {{
													childLayoutCenter();
													width("80");
													height("80");
													backgroundColor("#fffa");	
													interactOnClick("tileClick(tile1)");
											    }});
										    }});
										    //ENDE  tile1
											 //tile2
										    panel(new PanelBuilder("tile2outerCreep") {{
												childLayoutCenter();
												width("90");
												height("90");
												backgroundColor("#fffa");	
											    panel(new PanelBuilder() {{
													childLayoutCenter();
													width("80");
													height("80");
													backgroundColor("#fffa");
													interactOnClick("tileClick(tile2)");
											    }});
										    }});
										    //ENDE  tile2
											
									    }});
									    //ENDE  Panel um tile1 und 2
									    //Panel um tile3 und 4
									    panel(new PanelBuilder() {{
											childLayoutHorizontal();
											paddingLeft("10");
											paddingTop("10");
											width("232");
											height("90");
											 //tile1
										    panel(new PanelBuilder("tile4outerCreep") {{
												childLayoutCenter();
												width("90");
												height("90");
												backgroundColor("#fffa");	
											    panel(new PanelBuilder() {{
													childLayoutCenter();
													width("80");
													height("80");
													backgroundColor("#fffa");	
													interactOnClick("tileClick(tile4)");
											    }});
										    }});
										    //ENDE  tile1
											 //tile2
										    panel(new PanelBuilder("tile3outerCreep") {{
												childLayoutCenter();
												width("90");
												height("90");
												backgroundColor("#fffa");	
											    panel(new PanelBuilder() {{
													childLayoutCenter();
													width("80");
													height("80");
													backgroundColor("#fffa");
													interactOnClick("tileClick(tile3)");
											    }});
										    }});
										    //ENDE  tile2
											
									    }});
									    //ENDE  Panel um tile3 und 4					
									    //Panel um unteren Bereich
									  //Panel um oberen Text
									    panel(new PanelBuilder() {{
									    	visibleToMouse(true);
											childLayoutCenter();
											width("200");
											paddingTop("20");
											control(new ButtonBuilder("startButtonCreep", "START") {{
												alignCenter();
												valignCenter();
												interactOnClick("startButtonclick()");
												width("100px");
											}});
									    }});
									   //ENDE Panel um oberen Text
									    //ENDE  Panel um unteren Bereich	
										
								    }});
								    //Ende Verticales aeusseres Panel
								}});	
								//Ende Tile Selection Creep Panel
							}});	
							}});//ENDE Panel um Creepauwahl+Creep-Informationen
							
								//Panel um Towerauwahl+Tower-Informationen
								panel(new PanelBuilder("TowerSelection"){{
									childLayoutVertical();
									height("380");
									width("230");	
									visible(true);
							//Tower-Auswahl
							panel(new PanelBuilder(){{
								childLayoutCenter();
								height("380");
								width("230");
								//backgroundColor(new Color(0,0,0,0.1f));
						
										//Zeilen TowerAuswahl
										panel(new PanelBuilder(){{
											childLayoutVertical();
											height("355");
											width("205");
											paddingLeft("19");
											//backgroundColor(new Color(0,0,0,0.4f));
											style("nifty-panel");
											//Zeile1 TowerAuswahl
											panel(new PanelBuilder(){{
												childLayoutHorizontal();
												height("104");
												width("205");										
												//ImageTower1	
												panel(new PanelBuilder("tower1"){{
													childLayoutCenter();
													width("83");
													height("104");
													image(new ImageBuilder("tower1Image"){{
													filename("res/img/ingameControlbar/tower1.png");
													width("80");
													height("100");
													alignCenter();
								    				valignCenter();
								    				visible(true);
								    				interactOnClick("towerClick(0)");
								    				interactOnMouseOver("showInformationtextAndHovereffect(tower1)");
													}});
												}});	
												//Ende ImageTower1
												//ImageTower2	
												panel(new PanelBuilder("tower2"){{
													childLayoutCenter();
													width("83");
													height("104");
													image(new ImageBuilder("tower2Image"){{
													filename("res/img/ingameControlbar/tower2.png");
													width("80");
													height("100");
													alignCenter();
								    				valignCenter();
								    				visible(true);
								    				interactOnClick("towerClick(1)");
								    				interactOnMouseOver("showInformationtextAndHovereffect(tower2)");
													}});
												}});
												//Ende ImageTower2

											}});	
											//ENDE Zeile1 TowerAuswahl
											//Zeile2 TowerAuswahl
											panel(new PanelBuilder(){{
												childLayoutHorizontal();
												height("104");
												width("205");
											
												//ImageTower3	
												panel(new PanelBuilder("tower3"){{
													childLayoutCenter();
													width("83");
													height("104");
													image(new ImageBuilder("tower3Image"){{
													filename("res/img/ingameControlbar/tower3.png");
													width("80");
													height("100");
													alignCenter();
								    				valignCenter();
								    				visible(true);
								    				interactOnClick("towerClick(2)");
								    				interactOnMouseOver("showInformationtextAndHovereffect(tower3)");
													}});
												}});	
												//Ende ImageTower3
												//ImageTower4	
												panel(new PanelBuilder("tower4"){{
													childLayoutCenter();
													width("83");
													height("104");
													image(new ImageBuilder("tower4Image"){{
													filename("res/img/ingameControlbar/tower4.png");
													width("80");
													height("100");
													alignCenter();
								    				valignCenter();
								    				visible(true);
								    				interactOnClick("towerClick(3)");
								    				interactOnMouseOver("showInformationtextAndHovereffect(tower4)");
													}});
												}});
												//Ende ImageTower4
	

											}});
											//ENDE Zeile2 TowerAuswahl
											//Zeile3 TowerAuswahl
											panel(new PanelBuilder(){{
												childLayoutHorizontal();
												height("104");
												width("205");
											
												//ImageTower5	
												panel(new PanelBuilder("tower5"){{
													childLayoutCenter();
													width("83");
													height("104");
													image(new ImageBuilder("tower5Image"){{
													filename("res/img/ingameControlbar/tower5.png");
													width("80");
													height("100");
													alignCenter();
								    				valignCenter();
								    				visible(true);
								    				interactOnClick("towerClick(4)");
								    				interactOnMouseOver("showInformationtextAndHovereffect(tower5)");
													}});
												}});	
												//Ende ImageTower5
												//ImageTower6	
												panel(new PanelBuilder("tower6"){{
													childLayoutCenter();
													width("83");
													height("104");
													image(new ImageBuilder("tower6Image"){{
													filename("res/img/ingameControlbar/tower6.png");
													width("80");
													height("100");
													alignCenter();
								    				valignCenter();
								    				visible(true);
								    				interactOnClick("towerClick(5)");
								    				interactOnMouseOver("showInformationtextAndHovereffect(tower6)");
													}});
												}});
												//Ende ImageTower6												

											}});	
											//ENDE Zeile3 TowerAuswahl
											
										}});//ENDE Zeilen TowerAuswahl							
								
								
							}});							
							//ENDE Tower-Auswahl
								panel(new PanelBuilder() {{
									childLayoutCenter();
									//Tower-Informationen
									panel(new PanelBuilder("Tower Information"){{
										childLayoutCenter();
										height("280");
										width("232");
										//Zeilen
										panel(new PanelBuilder(){{
											childLayoutVertical();
											height("303");
											width("235");
											paddingLeft("10");
											backgroundColor(new Color(0,0,0,0.15f));
											//Zeile1
											panel(new PanelBuilder(){{
												childLayoutHorizontal();
												height("40");
												width("210");
												text(new TextBuilder("TowerName") {{
													font("verdana-small-regular.fnt");
													color(new Color(1,1,1,1));
													width("100");
													text("-");
													alignLeft();
													textHAlignLeft();
												}});
												text(new TextBuilder("TowerLevel") {{
													font("verdana-small-regular.fnt");
													color(new Color(1,1,1,1));
													text("-");
													alignRight();
													width("110");
													textHAlignRight();
												}});
											}});	
											//ENDE Zeile1
											//Zeile2
											panel(new PanelBuilder(){{
												childLayoutHorizontal();
												height("25");
												width("210");
												text(new TextBuilder("PriceTowerText") {{
													font("verdana-small-regular.fnt");
													color(new Color(1,1,1,1));
													text("Price");
													alignLeft();
													width("100");
													textHAlignLeft();
												}});
												text(new TextBuilder("PriceTowerValue") {{
													font("verdana-small-regular.fnt");
													color(new Color(1,1,1,1));
													width("110");
													text("-");
													alignRight();
													textHAlignRight();
												}});
											}});	
											//ENDE Zeile2
											//Zeile3
											panel(new PanelBuilder(){{
												childLayoutHorizontal();
												height("25");
												width("210");
												text(new TextBuilder("CooldownTowerText") {{
													font("verdana-small-regular.fnt");
													color(new Color(1,1,1,1));
													text("Cooldown");
													alignLeft();
													width("100");
													textHAlignLeft();
												}});
												text(new TextBuilder("CooldownTowerValue") {{
													font("verdana-small-regular.fnt");
													color(new Color(1,1,1,1));
													width("110");
													text("-");
													alignRight();
													textHAlignRight();
												}});
											}});	
											//ENDE Zeile3
											//Zeile4
											panel(new PanelBuilder(){{
												childLayoutHorizontal();
												height("25");
												width("210");
												text(new TextBuilder("RangeText") {{
													font("verdana-small-regular.fnt");
													color(new Color(1,1,1,1));
													text("Range");
													alignLeft();
													width("100");
													textHAlignLeft();
												}});
												text(new TextBuilder("RangeValue") {{
													font("verdana-small-regular.fnt");
													color(new Color(1,1,1,1));
													width("110");
													text("-");
													alignRight();
													textHAlignRight();
												}});
											}});	
											//ENDE Zeile4
											//Zeile5
											panel(new PanelBuilder(){{
												childLayoutHorizontal();
												height("25");
												width("210");
												text(new TextBuilder("DamageText") {{
													font("verdana-small-regular.fnt");
													color(new Color(1,1,1,1));
													text("Damage");
													alignLeft();
													width("100");
													textHAlignLeft();
												}});
												text(new TextBuilder("TowerDamageValue") {{
													font("verdana-small-regular.fnt");
													color(new Color(1,1,1,1));
													width("110");
													text("-");
													alignRight();
													textHAlignRight();
												}});
											}});	
											//ENDE Zeile5
											//Zeile6
											panel(new PanelBuilder(){{
												childLayoutHorizontal();
												height("25");
												width("210");
												text(new TextBuilder() {{
													font("verdana-small-regular.fnt");
													color(new Color(1,1,1,1));
													text("Spl dmg reduce");
													alignLeft();
													width("100");
													textHAlignLeft();
												}});
												text(new TextBuilder("SplashDamageReduceValue") {{
													font("verdana-small-regular.fnt");
													color(new Color(1,1,1,1));
													text("-");
													alignRight();
													width("110");
													textHAlignRight();
												}});
											}});	
											//ENDE Zeile6
											//Zeile7
											panel(new PanelBuilder(){{
												childLayoutHorizontal();
												height("25");
												width("210");
												text(new TextBuilder() {{
													font("verdana-small-regular.fnt");
													color(new Color(1,1,1,1));
													text("Splashradius");
													alignLeft();
													width("100");
													textHAlignLeft();
												}});
												text(new TextBuilder("SplashRadiusValue") {{
													font("verdana-small-regular.fnt");
													color(new Color(1,1,1,1));
													text("-");
													alignRight();
													width("110");
													textHAlignRight();
												}});
											}});	
											//ENDE Zeile7
											//Zeile8
											panel(new PanelBuilder(){{
												childLayoutHorizontal();
												height("25");
												width("210");
												text(new TextBuilder("SlowrateText") {{
													font("verdana-small-regular.fnt");
													color(new Color(1,1,1,1));
													width("100");
													text("Slowrate");
													alignLeft();
													textHAlignLeft();
												}});
												text(new TextBuilder("SlowrateValue") {{
													font("verdana-small-regular.fnt");
													color(new Color(1,1,1,1));
													width("110");
													text("-");
													alignRight();
													textHAlignRight();
												}});
											}});	
											//ENDE Zeile8
											//Zeile9
											panel(new PanelBuilder(){{
												childLayoutHorizontal();
												height("25");
												width("210");
												text(new TextBuilder("SlowtimeText") {{
													font("verdana-small-regular.fnt");
													color(new Color(1,1,1,1));
													width("100");
													text("Slowtime");
													alignLeft();
													textHAlignLeft();
												}});
												text(new TextBuilder("SlowtimeValue") {{
													font("verdana-small-regular.fnt");
													color(new Color(1,1,1,1));
													width("110");
													text("-");
													alignRight();
													textHAlignRight();
												}});
											}});	
											//ENDE Zeile9
											//Zeile10 Button
											panel(new PanelBuilder("upgradePanel"){{
												childLayoutVertical();
												paddingTop("5");
												height("60");
												width("210");
												panel(new PanelBuilder(){{
													childLayoutHorizontal();
													height("30");
													control(new ButtonBuilder("upgradeButton", "Upgrade") {{
														width("100");
														alignLeft();
														interactOnClick("upgradeTower()");
														visibleToMouse(true);
													}});
													panel(new PanelBuilder() {{
														width("15");
													}});
													control(new ButtonBuilder("sellButton", "Sell") {{
														width("100");
														alignRight();
														interactOnClick("sellTower()");
														visibleToMouse(true);
													}});
												}});
												panel(new PanelBuilder(){{
													childLayoutHorizontal();
													height("30");
													text(new TextBuilder() {{
														width("60");
														text("Strategy");
														textHAlignLeft();
														alignLeft();
														valignCenter();
													}});
													panel(new PanelBuilder() {{
														width("15");
													}});
													control(new DropDownBuilder("dropDown") {{
														width("140");
														alignRight();
														valignCenter();
													}});
												}});
											}});	
											//ENDE Zeile10 Button
										}});
										//ENDE Zeilen
									}});		
									//ENDE Tower-Informationen
									//Winner/Loser Panel
									panel(new PanelBuilder("Winner Panel") {{
										childLayoutCenter();
										height("280");
										width("232");
										panel(new PanelBuilder(){{
											childLayoutVertical();
											height("303");
											width("235");
											paddingLeft("10");
											paddingTop("20");
											backgroundColor(new Color(0,0,0,0.15f));
											panel(new PanelBuilder() {{
												height("50");
											}});
											text(new TextBuilder("Winner/Loser Text") {{
												alignCenter();
												font("aurulent-sans-36-bold-with-shadow.fnt");
												color(new Color(1,1,1,1));
												text("You Loose!");
											}});
											panel(new PanelBuilder() {{
												height("100");
											}});
											control(new ButtonBuilder("Leave Game", "LEAVE GAME") {{
												alignCenter();
												valignCenter();
												interactOnClick("leaveGame()");
												width("100px");
											}});
										}});
									}});
									//Winner/Loser Panel
									//Tile Selection Tower Panel
									panel(new PanelBuilder("Tile Selection Tower Panel") {{
										childLayoutCenter();
										width("232");
										height("280");
										panel(new PanelBuilder(){{
											childLayoutVertical();
											height("303");
											width("235");
											paddingLeft("20");
											paddingTop("20");
											backgroundColor(new Color(0,0,0,0.15f));
											//Panel um oberen Text
										    panel(new PanelBuilder() {{
												childLayoutCenter();
												height("20");
												text(new TextBuilder() {{
													font("verdana-small-regular.fnt");
													color(new Color(1,1,1,1));
													text("Please choose your tile.");
												}});
										    }});
										   //ENDE Panel um oberen Text
										    //Panel um tile1 und 2
										    panel(new PanelBuilder() {{
												childLayoutHorizontal();
												paddingLeft("10");
												paddingTop("10");
												width("232");
												height("90");
												 //tile1
											    panel(new PanelBuilder("tile1outerTower") {{
													childLayoutCenter();
													width("90");
													height("90");
													backgroundColor("#fffa");	
												    panel(new PanelBuilder() {{
														childLayoutCenter();
														width("80");
														height("80");
														backgroundColor("#fffa");	
														interactOnClick("tileClick(tile1)");
												    }});
											    }});
											    //ENDE  tile1
												 //tile2
											    panel(new PanelBuilder("tile2outerTower") {{
													childLayoutCenter();
													width("90");
													height("90");
													backgroundColor("#fffa");	
												    panel(new PanelBuilder() {{
														childLayoutCenter();
														width("80");
														height("80");
														backgroundColor("#fffa");
														interactOnClick("tileClick(tile2)");
												    }});
											    }});
											    //ENDE  tile2
												
										    }});
										    //ENDE  Panel um tile1 und 2
										    //Panel um tile3 und 4
										    panel(new PanelBuilder() {{
												childLayoutHorizontal();
												paddingLeft("10");
												paddingTop("10");
												width("232");
												height("90");
												 //tile1
											    panel(new PanelBuilder("tile4outerTower") {{
													childLayoutCenter();
													width("90");
													height("90");
													backgroundColor("#fffa");	
												    panel(new PanelBuilder() {{
														childLayoutCenter();
														width("80");
														height("80");
														backgroundColor("#fffa");	
														interactOnClick("tileClick(tile4)");
												    }});
											    }});
											    //ENDE  tile1
												 //tile2
											    panel(new PanelBuilder("tile3outerTower") {{
													childLayoutCenter();
													width("90");
													height("90");
													backgroundColor("#fffa");	
												    panel(new PanelBuilder() {{
														childLayoutCenter();
														width("80");
														height("80");
														backgroundColor("#fffa");
														interactOnClick("tileClick(tile3)");
												    }});
											    }});
											    //ENDE  tile2
												
										    }});
										    //ENDE  Panel um tile3 und 4					
										    //Panel um unteren Bereich
										  //Panel um oberen Text
										    panel(new PanelBuilder() {{
										    	visibleToMouse(true);
												childLayoutCenter();
												width("200");
												paddingTop("20");
												control(new ButtonBuilder("startButtonTower", "START") {{
													alignCenter();
													valignCenter();
													interactOnClick("startButtonclick()");
													width("100px");
												}});
										    }});
										   //ENDE Panel um oberen Text
										    //ENDE  Panel um unteren Bereich	
										}});
									}});	
								    //Ende Verticales aeusseres Panel
									//Ende Tile Selection Tower Panel
								}});	
							}});//ENDE Panel um Towerauwahl+Tower-Informationen
																					
						}});//ENDE Panel um Creep/Towerauswahl + jeweilige Infos	
							
							//Chat
							panel(new PanelBuilder("chatIngame"){{
								childLayoutHorizontal();
								paddingTop("296");
								paddingLeft("10");
								height("40");
								width("230");
								panel(new PanelBuilder() {{
									childLayoutHorizontal();
									control(new TextFieldBuilder("chatMessagesField", "") {{ 
										width("160");
										alignCenter();
										valignCenter();
										maxLength(250);
									}});
								}});
									panel(new PanelBuilder() {{
										childLayoutCenter();
										width("60px");
									control(new ButtonBuilder("sendButton", "Send") {{
										alignCenter();
										valignCenter();
										interactOnClick("sendMessageIngame()");
										width("60px");
									}});
								}});
							}});							
							//ENDE Chat
							
						}});//ENDE FELD3 rechte Kontrollleiste aeusseres Panel
						}});	
					//ENDE Panel um FELD2 und FELD3			
					}
				});

			}
		}.build(gui.getNifty());

		gui.getNifty().addScreen("ingameScreen", screen);
	}
			
public Element gettileSelectionPopup() {
	return tileSelectionPopup;
}
	public ChatManager getChatManager() {
		return chatManager;
	}
	
	public IngameController getController() {
		return controller;
	}
}
